package com.xqls.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xqls.dal.dao.RemotecontrolDao;
import com.xqls.dal.model.Remotecontrol;
import com.xqls.service.RemotecontrolService;
@Service
public class RemotecontrolServiceImpl implements RemotecontrolService{

	
	@Autowired private RemotecontrolDao remoteDao;
	@Override
	public boolean insertRemote(Remotecontrol remotecontrol) {
		return remoteDao.insertRemote(remotecontrol)>0;
	}

	@Override
	public Remotecontrol queryByDeviceNo(String deviceNo) {
		return remoteDao.queryByDeviceNo(deviceNo);
	}
	
	public boolean updateRemote(Remotecontrol remotecontrol){
		return remoteDao.updateRemote(remotecontrol)>0;
	}
	
	public Remotecontrol selectMaxTimeByDeviceNo(String deviceNo,String remoteType){
		return remoteDao.selectMaxTimeByDeviceNo(deviceNo, remoteType);
	}
	
	public  Remotecontrol selectMaxTime(String remoteType){
		Remotecontrol remoteControl = remoteDao.selectMaxTime(remoteType);
		return remoteControl;
	}

}
